package net.sending;

import net.message.Message;
import net.Client;
import net.SimpleSendingMessageFactory;

import java.util.HashSet;

/**
 *
 */
public class Multicast implements MulticastMessage {

    private final Message message;

    private final HashSet<Client> clients;

    public Multicast(Message message, HashSet<Client> clients) {
        this.clients = clients;
        this.message = message;
    }

    public void send() {
        for (Client client : clients) {
            new UDPUnicast(message, client).send();
        }
    }
}
